<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登陆</title>
<jsp:include page="/header.jsp"></jsp:include>
<link href="${basePath }/css/login.css" rel="stylesheet" type="text/css">
<script type="text/javascript">

	$(function() {
		$(window).keydown(function(event){
			switch(event.keyCode) {
				case 13:login();
			}
		});
	});
	
	function login(){
		$.ajax({
			url:"${basePath}/login/check.htm",
			type:"post",
			data:$("form").serialize(),
			dataType:"json",
			success:function(data) {
				if(data.isSuccess) window.location = "${basePath}/login/index.htm";
				else $.jqalert("用户名或密码错误！！", "");
			}
		});
	}
	
	function reset() {
		$(".login_form").find("input").val("");
		$("input[name='name']").focus();
	}
</script>
</head>
<body>
<form>
	<div class="login_main">
         <div class="login_form">
            <h1>门店POS销售管理</h1>
            <div class="label_box clearfix">
                <span class="sel_label fl">登录名：</span>
                <input type="text" name="name" class="text_input fl">
            </div>
            <div class="label_box clearfix">
                <span class="sel_label fl">密&nbsp;&nbsp;码：</span>
                <input type="password" name="password" class="text_input fl">
            </div>
            <div class="login_btn clearfix">
                <a href="javascript:;" class="green_btn btn fl" onclick="login();">登录</a>
                <a href="javascript:;" class="yellow_btn btn fl" onclick="reset();">清空</a>
            </div>
        </div>
    </div>
</form>
</body>
</html>